﻿using BySoft.Server.Common;
using BySoft.Server.Common.Entity;
using BySoft.Server.DataAccess;
using BySoft.Server.DataAccess.UserCode;
using OneSoft.DataAccess;
using OneSoft.EntityCore;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace BySoft.Server.Business
{
    public partial class BsOutbackmat
    {

        public static bool IsBillIDExists(string OutbackmatIDValue)
        {

            return ClsComm.CheckExist("BS_Outbackmat", "BillID", OutbackmatIDValue, true);

        }
        public static bool CheckUsed(string BillIDValue)
        {
          // return
            return ClsComm.CheckExist("BS_OutRepair", "OutBackMatID", BillIDValue, true);

        }
        public static bool SaveOrUpdate(BsOutbackmatEntity entity, bool isNew)
        {
            return BsOutbackmatDA.SaveOrUpdate(entity, isNew);
        }

        public static bool Del(string strCode)
        {
            return BsOutbackmatDA.Del(strCode);
        }

        public static DataTable SelectList(string strBillID, string strWorkOrderNo, string strSupplierID, string strFrom, string strEnd, int pageIndex, int PageSize, out int m_count)
        {
            return BsOutbackmatDA.SelectList(strBillID,strWorkOrderNo, strSupplierID, strFrom, strEnd, pageIndex, PageSize, out m_count);
        }
   public static DataTable SelectOutProcessDetail(bool isRepair,string strCurrentReturnBillID,string strBillID,string strWorkOrderNo,string strSupplierID, string strProcessID
            ,int  pageIndex, int PageSize, out int m_count)
        {
            return BsOutbackmatDA.SelectOutProcessDetail(isRepair,strCurrentReturnBillID,strBillID, strWorkOrderNo, strSupplierID,strProcessID,  pageIndex, PageSize, out m_count);
        }

   public static DataTable SelectOutProcessDetail(bool isRepair, string strCurrentReturnBillID, string strBillID)
   {
       int pageIndex = 0;
       int PageSize = 100;
       int m_count = 0;

       return BsOutbackmatDA.SelectOutProcessDetail(isRepair, strCurrentReturnBillID, strBillID, null, null, null, pageIndex, PageSize, out m_count);
   }

        public static DataTable SelectHeadData(string strBillID)
        {
            return BsOutbackmatDA.SelectHeadData(strBillID);
        }
        //public static DataTable SelectDetailData(string strBillID)
        //{
        //    return BsOutbackmatDA.SelectDetailData(strBillID);
        //}


        public static DataTable CreateDT()
        {

            DataTable dt = SelectHeadData("-1");
            return dt;

        }


    }
}
